/**
 * The instantiation of the player class.
 *
 * @author Levester Chaney
 * @version 0.0.1
 */

#include "abstractTypes.h"

player :: player()
{
	this->name = new char(MAX_STRING_SIZE);
	this->virtue = 0;
	this->hp = INITIAL_HEALTH_STAT;
	this->position = new location();
	this->pack = new inventory();
	this->innateSkills = new vector<ability*>();
	this->naturalSkillls = new vector<ability*>();
	this->skillset = new vector<ability*>();
}

player :: player(char* name)
{
	this->name = name;
	this->virtue = 0;
	this->hp = INITIAL_HEALTH_STAT;
	this->position = new location();
	this->pack = new inventory();
	this->innateSkills = new vector<ability*>();
	this->naturalSkillls = new vector<ability*>();
	this->skillset = new vector<ability*>();
}

player :: player(char* name, classType birthClass)
{
	this->name = name;
	this->virtue = 0;
	this->hp = INITIAL_HEALTH_STAT;
	this->position = new location();
	this->pack = new inventory();
	this->innateSkills = new vector<ability*>();
	this->naturalSkillls = new vector<ability*>();
	this->skillset = new vector<ability*>();
}

player :: player(char* name, classType birthClass, char* birthCity)
{
	this->name = name;
	this->virtue = 0;
	this->hp = INITIAL_HEALTH_STAT;
	this->position = new location();
	this->pack = new inventory();
	this->innateSkills = new vector<ability*>();
	this->naturalSkillls = new vector<ability*>();
	this->skillset = new vector<ability*>();
}

player :: ~player()
{
	// destroys this object
	delete this->name;
	delete this->position;
	delete this->pack;
	delete this->innateSkills;
	delete this->naturalSkillls;
	delete this->skillset;
}

char*
player :: getName() const
{
	return this->name;
}

signed short
player :: getVirtue() const
{
	return this->virtue;
}

char*
player :: getBirthWorld() const
{
	return this->birthWorld;
}

char*
player :: getBirthCity() const
{
	return this->birthCity;
}

classType
player :: getBirthClass() const
{
	return this->birthClass;
}

inventory*
player :: getInventory() const
{
	return this->pack;
}

unsigned int
player :: getHp() const
{
	return this->hp;
}

vector<ability*>
player :: getInnateSkills() const
{
	return (*this->innateSkills);
}

vector<ability*>
player :: getNaturalSkillls() const
{
	return (*this->naturalSkillls);
}

vector<ability*>
player :: getSkillset() const
{
	return (*this->skillset);
}
void
player :: addItem(item* i)
{
	this->pack->addItem(i);
}

void
player :: addAbility(ability* a)
{
	this->skillset->push_back(a);
}

void
player :: setLocation(short x, short y, short z)
{
	this->position = new location(x, y, z);
}

void
player :: setVirtue(signed short amount)
{
	this->virtue += amount;
}

void
player :: setHealth(unsigned int amount)
{
	this->hp += amount;
}

void 
player :: addInnateAbility(ability* a)
{
	this->innateSkills->push_back(a);
}

void
player :: addNaturakAbility(ability* a)
{
	this->naturalSkillls->push_back(a);
}

void
player :: setBirthWorld(char* world)
{
	this->birthWorld = world;
}
